import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);

const store = new Vuex.Store({
  state: {
    userInfo: {},
    tabBarList: [],
    checkedValue: 0, //tabbar 的value状态值
  },

  mutations: {
    setRoleId(state, data) {
      state.roleId = data;
      if (data == 1) {
        state.tabBarList = tabBar["admin"];
      }
      if (data == 2) {
        state.tabBarList = tabBar["fill"];
      }
    },
    setUserInfo(state, data) {
      state.userInfo = data;
      console.log(state.userInfo, 1112);
    },
  },
});

export default store;
